package com.asiainfo.integration.tibco;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.jms.Destination;

public class TestSendMessageToQueue {

    public static void testEmsQueue() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("config/spring/spring-config.xml");
        SendEmsQueueMessage sendEmsQueueMessage = (SendEmsQueueMessage) ac.getBean("sendEmsQueueMessage");
        Destination destination = (Destination) ac.getBean("destination");

        //NOTE: 发送给队列的消息
        String message = "Text message pure java";
        sendEmsQueueMessage.sendTextMessage(destination, message);
    }

    public static void main(String[] args) {
        testEmsQueue();
    }
}
